package com.yt.reflect.util;

import java.lang.reflect.Field;

public class PropertiesUtil {
	
	public void setProperty(Object obj,String propertyName,Object value) throws Exception{
		Class clazz = obj.getClass();
		System.out.println(clazz.getName());
		System.out.println(clazz.getSimpleName());
		
		Field f = clazz.getDeclaredField(propertyName);
		f.setAccessible(true);
		
		f.set(obj, value);
		
	}
}
